package com.example.test;

/**
 * Author:LiuZejiang
 * Date:2022/10/22  17:26
 * JDK-Version:1.8
 */
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class PersonDBOpenHelper extends SQLiteOpenHelper {

    //路径匹配
    public PersonDBOpenHelper(Context context) {
        super(context,"person.db",null,1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table info(_id integer primary key autoincrement,name varchar(50),phone varchar(20),UNIQUE(phone))");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        //删除并且重新建立
    }
}

